!pr1
!lm10
!rm77
Transfer ProDOS Files to DOS Disks.........Bob Sander-Cederlof

The CONVERT utility program which Apple supplies with ProDOS can be used to transfer ProDOS files to DOS disks, but only if the file type is supported under DOS.  Types BAS, INT, TXT, and BIN can be transferred; other types, such as SYS, cannot.

We needed a program which could transfer any reasonable file.  By reasonable, I mean the file must be able to fit on a floppy, and must not be a sparse file.  Sparse files could also be transferred, but we would need to handle them in a special manner beyond what we have done so far.

The files we need to transfer will be stored on the DOS disk, but they will not actually be used there.  We need them on a DOS disk (either floppy or a harddisk volume) so that a telecommunications downloading system can send them to a ProDOS-based caller.  Since our central system is DOS-based, all the files which are available for downloading must be on DOS disks.

We devised a scheme which should allow the files to be stored under the DOS-based central system, making very few changes to the central system.  We think the only central system change needed will be to use a different menu tree for callers who are calling with ProDOS callup disks.

ProDOS files have three essential descriptive items in addition to the filename:  file type (a single byte), auxiliary file type (two bytes), and end-of-file (three bytes).  DOS files also have a single byte file type, but it only may have one of eight possible values (0, 1, 2, 4, 8, 16, 32, or 64).  DOS files which need the equivalent of the auxiliary file type store it at the beginning of the data area of the file.  DOS files signal end-of-file by a terminal 00 byte, or by adding a two-byte value to the beginning of the data area.

ProDOS filenames are up to 15 characters long.  DOS filenames can be up to 30 characters long.  We decided to use the extra 15 characters in the DOS filename to encode the ProDOS filetype, auxiliary file type, and end-of-file value.  Thus a ProDOS file named "MY.FILE" with a type $FC (BAS), auxiliary type $0801 (this is the starting address), and end-of-file $030F (length of the file) would receive the DOS name of

       "MY.FILE        .FC.0801.00030F"

All of the data blocks of the ProDOS file will be directly written on DOS sectors, and the DOS file will be arbitrarily classified as a type T file.

When the central telecommunications system downloads this camouflaged ProDOS file, the ProDOS callup disk will first create a TXT file with all the data bytes.  When the DOS filename is received, the callup disk will modify the information in the ProDOS directory to the correct file type, auxiliary file type, and end-of-file values.
!np
The transfer utility is easy to use.  It runs in the DOS environment, and is invoked by the BRUN command.  The first thing the program wants to know is the slot and drive of the floppy disk drive containing the ProDOS diskette with files to be transferred.  You will see prompts "PRODOS SLOT:" and "DRIVE:", and should type in the appropriate data:

       PRODOS SLOT: 6
             DRIVE: 1

Since both slot and drive can only be one digit, the program responds as soon as you have typed a valid digit.  You will not need to type a RETURN.  If you type ESCAPE instead of a digit, the program will terminate.  If you type a backspace (left arrow) you will get another chance to enter both slot and drive.

Once the program knows the slot and drive, it will read in the catalog of the ProDOS in that drive.  The file names in the main directory will be displayed, along with the file type, auxiliary file type, and end-of-file values.  To the left of each filename the program will display a menu-selection letter.  Up to 20 filenames can be listed at once on the Apple screen.  At this point you can abort by typing the ESCAPE or the RETURN key, see another screenful of filenames by typing the SPACE key, or select a filename by typing a menu letter.

If the filename you select is a subdirectory file, you will get a new menu displaying the filenames in that subdirectory.  In this way you can go down any branch of the tree-structured directory.  Typing the SPACE key when there are no more filenames in particular subdirectory returns you to the beginning of the main directory.

If the filename you select is any other file type, that file will be transferred to a DOS disk volume.  You have to specify the slot, drive, and volume of the DOS volume.  You will be prompted like this:

          DOS SLOT: 7
             DRIVE: 1
            VOLUME: 14

Both slot and drive always require only one digit, so you do not type return after entering those items.  However, volume may be from 1 to 3 digits long.  You do have to type RETURN after the volume number.  If you type RETURN without entering any volume number, V0 will be assumed.  This will be valid for ANY volume number in a floppy drive.  You can abort the program by typing ESCAPE instead of any of these numbers, and you can go back to entering DOS SLOT by typing a backspace.

If you are transferring to a hard disk volume V0 indicates that the same volume number should be used as that of the most recent disk access.  It is hard to predict what that volume will be.  Moral:  be specific about the volume number if you are writing to a hard disk volume.
!np
After the file you selected has been transferred, you have the option to quit or to transfer another file.  If you want to transfer another file, you have the option to use the same slot/drive/volume numbers, or to change them.
